package com.ruoqing.core.domain.rqlog;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
    * @title: LogEntity
    * @projectName ruoxi-blog
    * @description: 若兮微服务 - 后台管理中心 - 日志数据传输对象
    * @author YaoXian
    * @date 2020-12-06 18:59
    */
@Data
@TableName(value = "ruoqing_log")
public class LogEntity implements Serializable {
    
    /** 日志主键 */
    @TableId(value = "log_id", type = IdType.AUTO)
    private Integer logId;
    
    /** 操作模块 */
    @TableField(value = "log_module")
    private String logModule;
    
    /** 业务类型 */
    @TableField(value = "log_business_type")
    private String logBusinessType;
    
    /** 请求方法 */
    @TableField(value = "log_method")
    private String logMethod;
    
    /** 请求方式 */
    @TableField(value = "log_request_method")
    private String logRequestMethod;
    
    /** 操作人类别 */
    @TableField(value = "log_operator_type")
    private String logOperatorType;
    
    /** 操作人姓名 */
    @TableField(value = "log_operator_name")
    private String logOperatorName;
    
    /** 操作人分组 */
    @TableField(value = "log_dept_name")
    private String logDeptName;
    
    /** 请求地址 */
    @TableField(value = "log_operator_url")
    private String logOperatorUrl;
    
    /** IP地址 */
    @TableField(value = "log_operator_ip")
    private String logOperatorIp;
    
    /** 请求状态码 */
    @TableField(value = "log_status")
    private String logStatus;
    
    /** 操作时间 */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "log_operator_time")
    private Date logOperatorTime;
    
    /** 操作 */
    @TableField(value = "log_operate")
    private String logOperate;

    public static final String COL_LOG_ID = "log_id";

    public static final String COL_LOG_MODULE = "log_module";

    public static final String COL_LOG_BUSINESS_TYPE = "log_business_type";

    public static final String COL_LOG_METHOD = "log_method";

    public static final String COL_LOG_REQUEST_METHOD = "log_request_method";

    public static final String COL_LOG_OPERATOR_TYPE = "log_operator_type";

    public static final String COL_LOG_OPERATOR_NAME = "log_operator_name";

    public static final String COL_LOG_DEPT_NAME = "log_dept_name";

    public static final String COL_LOG_OPERATOR_URL = "log_operator_url";

    public static final String COL_LOG_OPERATOR_IP = "log_operator_ip";

    public static final String COL_LOG_STATUS = "log_status";

    public static final String COL_LOG_OPERATOR_TIME = "log_operator_time";
}